<template>
	<view class="container">
		<view class="item" v-for="(item,index) in storeList" :key="index" @tap="goDetail(item.seller_id)">
			<!-- <image lazy-load :src="item.logo" mode=""></image> -->
			<view class="image-wrapper">
				<easy-loadimage mode="aspectFill"
				    :scroll-top="scrollTop"
				    :image-src="item.logo"></easy-loadimage>
			</view>
			<view class="infoBox">
				<view class="title">
					<view class="title__name">
						<image class="a" v-if="item.seller_type == 2" src="../../static/images/public/123.png" mode=""></image>
						<text class="name">{{item.seller_name}}</text>
						<text class="back" v-if="item.rebate_proportion&&item.shop_commission_retrun_mode == 1">黑贝壳:{{item.rebate_proportion}}%</text>
						<text class="back" v-if="item.integral_rate&&item.shop_commission_retrun_mode == 2">积分:{{item.integral_rate}}%</text>
					</view>
				</view>
				<view class="info__rate">
					<uni-rate class="rate" active="white" normal="white" bgSeleColor="#F86436" bgNoSeleColor="grey" :isIndexRate="true"
					 :size="15" :current="Number(item.quality)" disabled></uni-rate>
					 <text class="fen">{{item.quality}}</text>
					<text class="count">{{item.browse_num}}人浏览过</text>
				</view>
				<view class="info__type">
					<text>{{item.cate_name}}</text>
					<text class="b clamp">{{item.region}}</text>
					<text class="c">{{item.distance}}</text>
				</view>
				<view class="info__label">
					<view class="label_item" v-for="(it,ind) in item.label" :key="ind">{{it}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			storeList: {
				type: Array,
			},
			scrollTop: {
				type: Number,
			}
		},

		data() {
			return {}
		},
		methods: {
			//详情页
			goDetail(id) {
				uni.navigateTo({
					url: "/pages/index/detail?id=" + id
				})
			}
		}
	}
</script>
</script>

<style lang="scss" scoped>
	.item {
		box-sizing: border-box;
		width: 750rpx;
		height: 250rpx;
		display: flex;
		justify-content: space-between;
		padding: 30rpx;
		background-color: #fff;
		border-top: 10rpx solid #f8f8f8;
	
		.image-wrapper {
			width: 180rpx;
			height: 180rpx;
			border-radius: 8rpx;
			overflow: hidden;
			background: #fafafa;
		}
	
		.infoBox {
			position: relative;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			width: 470rpx;
	
			.title {
				display: flex;
				justify-content: space-between;
	
				.title__name {
					letter-spacing: 0.5rpx;
					font-weight: bold;
					color: rgba(51, 51, 51, 1);
					font-size: 30rpx;
					max-width: 470rpx;
					display: flex;
					align-items: center;
	
					.a {
						width: 70rpx;
						height: 28rpx;
						margin-right: 10rpx;
					}
	
					.name {
						flex: 1;
						height: 40rpx;
						line-height: 40rpx;
						overflow: hidden;
						display: block;
						white-space: nowrap;
						text-overflow: ellipsis;
					}
					.back {
						padding:3rpx 8rpx;
						text-align: center;
						border: 1rpx solid #F86436;
						border-radius: 5rpx;
						font-size: 20rpx;
						font-weight: normal;
						color: #F86436;
						margin-left: 8rpx;
					}
				}
			}
	
			.info__rate {
				.rate {
					margin-right: 20rpx;
				}
				.fen{
					margin-right: 20rpx;
					font-size: 26rpx;
					font-weight: 400;
					color: #F86436;
				}
				.count {
					font-size: 24rpx;
					font-weight: 400;
					color: #999999;
				}
			}
	
			.info__type {
				display: flex;
				font-size: 24rpx;
				font-weight: 400;
				color: rgba(153, 153, 153, 1);
				.b{
					flex:1;
					margin-left: 20rpx;
				}
				.c{
					color: #333;
					text-align: right;
				}
			}
	
			.info__label {
				max-width: 100%;
				overflow: hidden;
				display: block;
				white-space: nowrap;
				text-overflow: ellipsis;
				.label_item {
					display: inline-block;
					background: #F6FCF9;
					border-radius: 4rpx;
					padding: 4rpx 6rpx;
					color: #36C177;
					font-size: 22rpx;
					margin-right: 15rpx;
				}
			}
	
			.info {
				display: flex;
				justify-content: space-between;
				font-size: 20rpx;
	
				.left {
					color: #999;
	
					text:nth-of-type(1) {
						margin-right: 20rpx;
					}
				}
	
				.right {
					font-size: 26rpx;
					color: $theme-color;
				}
			}
	
			.detail {
				font-size: 24upx;
				color: #333;
				display: flex;
				justify-content: space-between;
	
				text:nth-of-type(1) {
					width: 320rpx;
					overflow: hidden;
					white-space: nowrap;
					text-overflow: ellipsis;
				}
	
				text:nth-of-type(2) {
					color: #999;
				}
			}
		}
	}
</style>
